import Vuex from 'vuex'

const store = new Vuex.Store({
	state: {
		islogin: uni.getStorageSync("token") || false, //是否登录
		userId: ''
	},
	mutations: {
		// 设置登录状态
		loginChange(state, ns) {
			state.islogin = ns
		},
		// 设置用户id
		setUserId(state, id) {
			state.userId = id
		}
	}
})
export default store